package com.bhs.mapper;

import com.bhs.pojo.Order;
import com.bhs.pojo.OrderItem;
import com.bhs.pojo.OrderVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {
    //    @Select("SELECT tb_order.order_id, user_id, add_id, payment,STATUS, create_time, " +
//            "update_time, payment_time, consign_time, end_time, close_time, shipping_name, shipping_code, " +
//            "buyer_nick, buyer_rate id,item_id,num,title,price,total_fee," +
//            "pic_path FROM tb_order JOIN order_item WHERE user_id=#{userId}")
//    List<OrderVO> getOrderListById(Long userId);
    @Select("select order_id, user_id, add_id, payment,status, create_time," +
            "update_time, payment_time, consign_time, end_time, close_time, shipping_name, shipping_code," +
            "buyer_nick, buyer_rate from tb_order where user_id=#{userId}")
    List<Order> getOrderListById(Long userId);

    @Select("select id,item_id,num,title,price,total_fee,pic_path from order_item where order_id=#{id}")
    List<OrderItem> getOrderItemListByOrderId(String id);

}
